package com.joysuch.wwyt.api.sync;


import com.joysuch.wwyt.api.sync.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class BaseDataSyncJob {

    @Autowired
    private BaseSyncEquipmentService baseEquipmentService;

    @Autowired
    private BaseSyncUserService baseSyncUserService;

    @Autowired
    private BaseSyncContractorService syncContractorService;

    @Autowired
    private BaseSyncContractorStaffService syncContractorStaffService;

    @Autowired
    private BaseSyncUserCertService baseSyncUserCertService;


 // @Scheduled(cron = "${wwyt.sync.basedata.schedule}")
    public void batchSyncEquip() {
        // 设备列表同步
      baseEquipmentService.syncEquipment();

    }

   // @Scheduled(cron = "0 0/10 * * * ?")
    public void batchSyncContract() {

        //承包商
        syncContractorService.syncContractor();

        //承包商人员
        syncContractorStaffService.syncContractorStaff();



    }

  //  @Scheduled(cron = "0 0 2 * * ?")
    public void batchSyncUser() {

        //人员列表同步
        baseSyncUserService.syncUserInfo();

        //人员证件
        baseSyncUserCertService.syncUserCert(true);

        //承包商人员证件
        baseSyncUserCertService.syncUserCert(false);


    }

}
